  References  :
Microsoft ActiveX Data Objects 2.7 Library
Microsoft Excel 10.0 Object Library
10    


Components:
Microsoft Common Dialog Contral 6.0
Microsoft Windows Common Contrals 6.0



firstRow
        

currentRow
        

currentCell
     

While currentCell <> ""
       Loop
 while      
       10    for

Set xlSheet = Worksheets(1)
 xlSheet      


xlSheet.Cells(currentRow, 1)
 currentRow    
 1  

    
Set rs = cn.Execute("SELECT * FROM TableName   WHERE id=" & xlSheet.Cells(currentRow, 1).Value & "")
             id 

If rs.EOF Then
       
    cn.Execute "insert into TableName(id,name,tel,notes) values(" & xlSheet.Cells(currentRow, 1).Value & ",'" & xlSheet.Cells(currentRow, 2).Value & "','" & xlSheet.Cells(currentRow, 3).Value & "','" & xlSheet.Cells(currentRow, 4).Value & "')"
Else
       
    cn.Execute "update TableName set name='" & xlSheet.Cells(currentRow, 2).Value & "',tel='" & xlSheet.Cells(currentRow, 3).Value & "',notes='" & xlSheet.Cells(currentRow, 4).Value & "'   WHERE id=" & xlSheet.Cells(currentRow, 1).Value & ""
End If

currentRow = currentRow + 1
     
currentCell = xlSheet.Cells(currentRow, 1).Value


             

